// 获取DOM元素
const contactCard = document.getElementById('contactCard');
const contactPopup = document.getElementById('contactPopup');

// 点击卡片显示弹窗
contactCard.addEventListener('click', function (e) {
    e.preventDefault(); // 阻止默认行为
    contactPopup.classList.add('active');
});

// 点击弹窗外部区域关闭弹窗
document.addEventListener('click', function (e) {
    if (e.target === contactPopup) {
        contactPopup.classList.remove('active');
    }
});

// 点击ESC键关闭弹窗
document.addEventListener('keydown', function (e) {
    if (e.key === 'Escape' && contactPopup.classList.contains('active')) {
        contactPopup.classList.remove('active');
    }
});